package com.enmaster;
import org.springframework.web.bind.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.Vector;

@RestController
public class Hello {

    private String pushWeb = "";
    private int randomInt(){
        return (int)(Math.random()*4);
    }

    @GetMapping("/hello")
    public String hello() {
        ArrayList<String> wordList = new ArrayList<>();
        wordList.add("lambda");
        wordList.add("spring boot");
        wordList.add("spring mvc");
        wordList.add("Jdbc");
        String pushWeb = wordList.get(randomInt());
        return pushWeb;}
    @GetMapping("/demo/{id}")
    public String demo(@PathVariable("id") String id){
        System.out.println("id=" + id);
        return id;
    }
}
